#include "udp_server.hpp"
#include <memory>

void Usage(const char *proc)
{
    printf("Usage: %s ip port\n\n", proc);
}

int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        Usage(argv[0]);
        return 1;
    }
    std::string ip = argv[1];
    uint16_t port = atoi(argv[2]);
    if (ip == "any")
        ip = "0.0.0.0";

    std::unique_ptr<UdpServer> p_usvr(new UdpServer(ip, port));
    p_usvr->InitServer();
    p_usvr->Start();
    return 0;
}